package wqh.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wqh.dao.ChannelDao;
import wqh.domain.Channel;
import wqh.pojo.ChannelUpdate;
import wqh.pojo.SelectIPandChannelCondition;
import wqh.service.ChannelService;

import java.util.List;

@Service("channelService")
public class ChannelServiceImpl implements ChannelService {

    @Autowired
    private ChannelDao channelDao;

    public Integer selectCount() {
        return channelDao.selectCount();
    }

    public List<Channel> findAllRecord() {
        return channelDao.findAllRecord();
    }

    public Channel findByIPandChannel(SelectIPandChannelCondition selectIPandChannelCondition) {
        return this.channelDao.findByIPandChannel(selectIPandChannelCondition);
    }

    public List<Channel> findByName(String name) {
        return this.channelDao.findByName(name);
    }

    public Channel findByID(Integer id) {
        return this.channelDao.findByID(id);
    }

    public int insertRecord(Channel channel) {
        return channelDao.insertRecord(channel);
    }

    public int updateRecord(Channel channel) {
        return channelDao.updateRecord(channel);
    }

    public int updateRecord2(ChannelUpdate channelUpdate) {
        return this.channelDao.updateRecord2(channelUpdate);
    }

    public int deleteById(Integer id) {
        return channelDao.deleteById(id);
    }

    public int deleteByClass(Channel channel) {
        return this.channelDao.deleteByClass(channel);
    }
}
